home *** CD-ROM | disk | FTP | other *** search
/ Gigarom 1 / Gigarom Macintosh Archives (Quantum Leap)(CDRM1080320)(1993).iso / FILES / HYP / H-I / HyperEdit.cpt / HyperEdit / card_3057.txt < prev    next >
Text File  |  1989-03-18  |  6KB  |  187 lines

  1. -- card: 3057 from stack: in
  2. -- bmap block id: 3458
  3. -- flags: 0000
  4. -- background id: 2644
  5. -- name: 
  6.  
  7.  
  8. -- part 1 (field)
  9. -- low flags: 01
  10. -- high flags: 2007
  11. -- rect: left=0 top=137 right=342 bottom=512
  12. -- title width / last selected line: 0
  13. -- icon id / first selected line: 0 / 0
  14. -- text alignment: 0
  15. -- font id: 3
  16. -- text size: 12
  17. -- style flags: 0
  18. -- line height: 16
  19. -- part name: Help
  20.  
  21.  
  22. -- part 2 (button)
  23. -- low flags: 00
  24. -- high flags: A000
  25. -- rect: left=0 top=51 right=103 bottom=65
  26. -- title width / last selected line: 0
  27. -- icon id / first selected line: 1662 / 1662
  28. -- text alignment: 1
  29. -- font id: 0
  30. -- text size: 12
  31. -- style flags: 0
  32. -- line height: 16
  33. -- part name: Edit a script
  34. ----- HyperTalk script -----
  35. on mouseup
  36.   global hyperedittemp
  37.   hyperedit
  38. end mouseup
  39.  
  40.  
  41. -- part 69 (button)
  42. -- low flags: 00
  43. -- high flags: A000
  44. -- rect: left=437 top=51 right=103 bottom=512
  45. -- title width / last selected line: 0
  46. -- icon id / first selected line: 4774 / 4774
  47. -- text alignment: 1
  48. -- font id: 0
  49. -- text size: 12
  50. -- style flags: 0
  51. -- line height: 16
  52. -- part name: Install In Home
  53. ----- HyperTalk script -----
  54. on mouseup
  55.   answer "Are you sure you want to do this?" with Ok or Cancel
  56.   if it is "Ok" then
  57.     set userlevel to 5
  58.     set lockscreen to true
  59.     set lockmessages to true
  60.     set lockrecent to true
  61.     push card
  62.     go home
  63.     put the long name of this stack into deststack
  64.     delete char 1 to 7 of deststack
  65.     delete last char of deststack
  66.     pop card
  67.     put the long name of this stack into srcstack
  68.     delete char 1 to 7 of srcstack
  69.     delete last char of srcstack
  70.     rescopy srcstack,deststack,"XCMD",300
  71.     rescopy srcstack,deststack,"DLOG",2238
  72.     rescopy srcstack,deststack,"DLOG",11305
  73.     rescopy srcstack,deststack,"DLOG",1331
  74.     rescopy srcstack,deststack,"DITL",3265
  75.     rescopy srcstack,deststack,"DITL",16969
  76.     rescopy srcstack,deststack,"DITL",30874
  77.     rescopy srcstack,deststack,"DITL",27339
  78.     rescopy srcstack,deststack,"ALRT",30844
  79.     rescopy srcstack,deststack,"WIND",27988
  80.     set lockscreen to false
  81.     set lockrecent to false
  82.     set lockmessages to false
  83.     answer "Hyperedit is installed in Home." with Ok
  84.     answer "Please quit and relaunch HyperCard to use it." with OK
  85.   end if
  86. end mouseup
  87.  
  88.  
  89. -- part contents for card part 1
  90. ----- text -----
  91. Hyperedit is a FREE XCMD HyperCard script editor; if you are going to give it to someone else, give it to them with this stack.  Hyperedit may not be sold, nor may it be included on public domain disks that are being sold.
  92.  
  93. Hyperedit has reached its first stable state, and I have been using it consistently now for a while.  HOWEVER, AS WITH ALL PUBLIC DOMAIN PROGRAMS, YOU SHOULD BE VERY CAREFUL USING THIS.  There is one bad bug that I know of.  If you try to edit the script of an object that does not exist, you will get a system error.  The way you could do this is by typing 'hyperedit blah' into the msg window where blah does not exist.  So far, I have found no way to verify if an object actually exists from within an XCMD.  Because of this problem and the probability of typos, I do not recommend trying to pass an argument to Hyperedit from the msg window for now.
  94.  
  95. To run Hyperedit, you have a number of options:
  96. 1) You can type  hyperedit  in the msg window.
  97. 2) Put the following script along with hyperedit in your home stack:
  98.  
  99. on mousewithin
  100.   global hyperedittemp
  101.   set lockmessages to true
  102.   set lockrecent to true
  103.   if (the commandkey is down) and (the shiftkey is down) then
  104.     hyperedit the target
  105.   end if
  106.   set lockrecent to false
  107.   set lockmessages to false
  108. end mousewithin
  109.  
  110. Whenever you are within a button or field and hold down the command and shift keys, you will run hyperedit with the appropriate script loaded.  Try doing this on this stack which has this handler in it.
  111.  
  112. 3) You could also use this handler:
  113.  
  114. on controlkey thekey
  115.   global hyperedittemp
  116.   if thekey = 5 then
  117.     hyperedit the name of this stack
  118.   end if
  119. end controlkey
  120.  
  121. When you hit Control-e, you will run hyperedit.  Try it.
  122.  
  123. 4) Finally, you could use this handler:
  124. on returnkey
  125.   global hyperedittemp
  126.   if the shiftkey is down and the optionkey is down then
  127.     hyperedit the name of this card
  128.   else if the optionkey is down then
  129.     hyperedit the name of this background
  130.   else if the shiftkey is down then
  131.     hyperedit the name of this stack
  132.   else
  133.     pass returnkey
  134.   end if
  135. end returnkey
  136.  
  137. When you run Hyperedit, you  get an additional menu in your menubar.  From this menu, you can do the following:
  138.  
  139. Edit a new script -- This gives you a list of scripts available.  You can also get it by holding down the command and shift keys and holding down the mouse button.
  140.  
  141. Save your current script
  142. Print your current script
  143. Execute the commands in the current selection range
  144. Comment out the current selection range
  145. Uncomment the current selection range
  146. Find text
  147. Find the next occurence of something you found
  148. Change text (including a replace all)
  149. Leave Hyperedit
  150. Get a wimpy about box
  151.  
  152. You also have access to a number of the standard HyperCard menus.  For instance, you can access desk accessories while in Hyperedit.  The following are the menu items you should be able to access:
  153.  
  154. Desk accessories
  155. MultiFinder entries
  156. New Stack
  157. Open Stack
  158. Save a Copy
  159. Compact Stack
  160. Quit HyperCard
  161. Cut
  162. Copy
  163. Paste
  164. New Card
  165. Background
  166. Back
  167. Home
  168. Help
  169. Recent
  170. First
  171. Prev
  172. Next
  173. Last
  174. Button Info (Sometimes)
  175. Field Info (Sometimes)
  176. Card Info
  177. Bkgnd Info
  178. Stack Info
  179. New Button
  180. New Field
  181. New Background
  182.  
  183. Currently, I don't do undos, and I also allow only one window open at a time.  I hope to have future releases implement these (no promises however).  If you want to always be able to run hyperedit, you can install it by clicking on the Install in Home button, but it's up to you to put whichever scripts you want in your home stack to activate Hyperedit.  Also, for Hyperedit to be recognized as a command, you will have to quit HyperCard after installing it in your home stack.  As with all new programs, be careful using this, and look for new releases fixing bugs.  Enjoy.
  184.  
  185. Doug Werner
  186. Apple Computer
  187. alink: Werner1